<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" xml:lang="pt" lang="pt">

	<c:set var="ctx" value="#{facesContext.externalContext.request.contextPath}" />
	<h:head>
		<title>::Igreja Ministério da Restauração::</title>
		<meta name="author" content="Ana Paula Lopes Araújo" />
		<link href="${ctx}/common/styles/frame.css" type="text/css" rel="stylesheet" />
		<link rel="shortcut icon" href="#{ctx}/common/images/favicon.ico"/>
	</h:head>
	<h:body>
		<div id="content" style="background-color: white; border: 1px #F0F0F0 solid;" >
			<div id="header"></div>
			<div id="menu">	
				<h:form> 
				    <p:menubar style="border: 1px #F0F0F0 solid;">
				    	<p:menuitem value="Home" url="/view/home.xhtml" />
				    	<p:submenu label="Igreja">  
				            <p:menuitem value="Quem somos" url="/view/quemSomos.xhtml"/>  
				            <p:menuitem value="Visão/Missão" url="/view/visaoMisao.xhtml"/>
				            <p:menuitem value="Pastores" url="/view/pastores.xhtml"/>
				            <p:menuitem value="História da igreja" url="/view/historiaIgreja.xhtml"/>  
				        </p:submenu>
				    	<p:submenu label="Ministérios">  
				            <p:menuitem value="Família" url="/view/ministerioFamilia.xhtml"/>  
				            <p:menuitem value="Jovens" url="/view/ministerioJovens.xhtml"/>
				            <p:menuitem value="Crianças" url="/view/ministerioCriancas.xhtml"/>
				            <p:menuitem value="Homens" url="/view/ministerioHomens.xhtml"/>
				            <p:menuitem value="Mulheres" url="/view/ministerioMulheres.xhtml"/>
				            <p:menuitem value="Louvor" url="/view/ministerioLouvor.xhtml"/>  
				        </p:submenu>
				        <p:menuitem value="Devocional" url="/view/devocional.xhtml" />
				    	<p:menuitem value="Contato" url="/view/contato.xhtml" />
				    	<p:menuitem value="Login" url="javascript:void(0)" style="position: absolute;right: 20px;" onclick="dlg.show()"/>  
				    </p:menubar>  
				</h:form>
			</div> 
			<ui:insert name="body" />
			<div class="rodape" id="divNaoImprimir" >
				Igreja Ministério da Restauração - Brasília DF<br/>
				QSB 01 Lote 01 - Taguatinga - DF<br/>
				fone: (61) 9999.9999
			</div>
		</div> 
		<!-- LOGIN -->	 
		<p:growl id="growl" showDetail="true" life="3000" />
		
		<p:dialog id="dialog" header="Login" widgetVar="dlg">
			<h:form>
				<h:panelGrid columns="2" cellpadding="5">
					<h:outputLabel for="username" value="Usuário:" />
					<p:inputText value="#{loginBean.username}" id="username" required="true" label="username" />

					<h:outputLabel for="password" value="Senha:" />
					<h:inputSecret value="#{loginBean.password}" id="password" required="true" label="password" />

					<f:facet name="footer">
						<p:commandButton id="loginButton" value="Login" update=":growl" actionListener="#{loginBean.login}"
							oncomplete="handleLoginRequest(xhr, status, args)" />
					</f:facet>
				</h:panelGrid>
			</h:form>
		</p:dialog>
		
		<script type="text/javascript">  
			  function handleLoginRequest(xhr, status, args) {  
			      if(args.validationFailed || !args.loggedIn) {  
			          jQuery('#dialog').effect("explode", { times:3 }, 300);  
			      } else {  
			          dlg.hide();  
			          jQuery('#loginLink').fadeOut();  
			      }  
			  }  
			</script>
	</h:body>
</html>

